package two;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;

public class demo2 {
    public static void main(String[] args) {
        HashMap<Integer, List<String>> map = new HashMap<>();

        Random random = new Random();

        int userNum = 10;
        int bookNum = 500;
        int userBuyNum = 80;

        for (int i = 0; i < userNum; i++) {
            List<String> list = new ArrayList<>();
            for (int j = 0; j < userBuyNum; j++) {
                list.add("book"+random.nextInt(bookNum));
            }
            map.put(i, list);
        }

        BookRecommendationSystem bookSystem =
                new BookRecommendationSystem(map);

        List<String> strings = bookSystem.recommendBooks(1);
        System.out.println("用户已买的图书");
        System.out.println(map.get(1).size());
        map.get(1).forEach(System.out::println);

        System.out.println("推荐的图书");
        System.out.println(strings.size());
        strings.forEach(System.out::println);

    }
}
